<template>
  <div class="likes">
    <topbar/>
    <div class="likes_nav">
      <div class="likes_nav_mid">
        <router-link to="/">
          <img src="@/assets/images/logo/xiaobaishop_0.png">
        </router-link>
        <div class="likes_nav_nav">
          <div :class="[nav_index==index ? 'likes_nav_nav_btn likes_nav_nav_btn_hover' : 'likes_nav_nav_btn']"
               @click="change_index(index)" v-for="(data,index) in nav_list" :key="index">{{ data }}
          </div>
        </div>
        <div class="likes_nav_search">
          <div class="likes_nav_search_right">
            <input type="text" placeholder="搜索商品" v-model="search_text">
            <el-button size="mini" @click="search_btn">搜索</el-button>
          </div>
        </div>
      </div>
    </div>
    <div class="likes_shop_box" v-show="nav_index==1">
      <div class="likes_shop_items" v-for="data in 10">
        <div class="likes_shop_items_info">
          <div class="likes_shop_items_info_item">
            <div class="likes_shop_items_info_item_img">
              <router-link to="/">
                <img :src="test_img" alt=""/>
              </router-link>
            </div>
            <div class="likes_shop_items_info_item_name">
              <router-link to="/">
                <span>小白官方自营店</span>
              </router-link>
              <i class="el-icon-delete-solid" title="删除"></i>
            </div>
          </div>
          <div class="likes_shop_items_info_other">
            相似店铺 <i class="el-icon-caret-right"></i>
          </div>
        </div>
        <div class="likes_shop_items_other">
          <div class="likes_shop_items_other_top">
            <div
              :class="[index==shop_index ? 'other_top_item_hover likes_shop_items_other_top_item' : 'likes_shop_items_other_top_item']"
              v-for="(data,index) in shop_item_nav" :key="index"
              @click="click_shop_index(index)">{{ data }}
            </div>
          </div>
          <div class="likes_shop_items_other_item">
            <div class="likes_shop_items_other_item_box" v-for="data in 6">
              <div class="likes_shop_items_other_item_box_img"><img :src="test_img"/></div>
              <div class="likes_shop_items_other_item_box_price"><span>￥</span><span>20.00</span></div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="likes_shop_box" v-show="nav_index==0">
      <div class="likes_commodity_items" v-for="data in 10">
        <div class="likes_commodity_items_img"><img :src="test_img"/></div>
        <div class="likes_commodity_items_other">
          <div class="likes_commodity_items_other_title">
            <router-link :to="{path:'/items',query:{id:1}}">
              <span>ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全ui哦汝麒茹完全</span>
            </router-link>
          </div>
          <div class="likes_commodity_items_other_price">
            <span>￥</span>
            <span>200.00</span>
          </div>
          <div class="likes_commodity_items_other_delbtn">
            <span>进入店铺</span>
            <span>找相似</span>
            <span>删除</span>
          </div>
        </div>
      </div>
    </div>
    <bottom/>
  </div>
</template>

<script>
import topbar from '@/components/topbar.vue'
import bottom from '@/components/bottom.vue'

export default {
  name: "likes",
  data() {
    return {
      message:'',
      search_text: '',
      nav_index: 0,
      shop_index: 0,
      shop_item_nav: [
        "最近上新",
        "热销"
      ],
      test_img: 'https://img.alicdn.com/bao/uploaded/i2/2200644942635/O1CN01PhEq5X1VKsNL8SWUB_!!2200644942635.jpg_160x160xz.jpg',
      nav_list: [
        "商品收藏",
        "店铺收藏"
      ]
    }
  },
  created() {
      this.message = function (data){
        this.$message.warning(data)
      }
  },
  methods: {
    search_btn(){
      if(this.search_text==null||this.search_text==""){
        this.message("您还没输入内容呢~")
      }
    },
    click_shop_index(index) {
      this.shop_index = index
    },
    change_index(index) {
      this.nav_index = index
    }
  },
  components: {
    topbar,
    bottom
  },
}
</script>

<style scoped>
.likes_nav_search_right input:focus {
  border-style: unset;
}

.likes_nav_search_right input:hover {
  border-style: unset;
}

.likes_nav_search_right input {
  height: 40px;
  width: calc(100% - 75px);
  outline: none;
  border-style: unset;
  padding-left: 10px;
}

.likes_nav_search_right {
  width: 450px;
  height: 40px;
  margin: 5px 0px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  background-color: #ffffff;
  float: right;
}

.likes_shop_items_other_item_box_price span {
  color: #ff4400;
  font-size: 20px;
  line-height: 30px;
  text-align: center;
}

.likes_shop_items_other_item_box_price span:nth-child(1) {
  font-size: 10px;
  font-weight: bold;
}

.likes_shop_items_other_item_box_price {
  width: 100%;
  height: 30px;
}

.likes_shop_items_other_item_box_img img {
  width: 100%;
  height: 100%;
}

.likes_shop_items_other_item_box_img {
  width: 100%;
  height: 124px;
  overflow: hidden;
}

.likes_shop_items_other_item_box {
  width: 130px;
  height: 100%;
}

.likes_shop_items_other_item {
  width: 100%;
  height: 154px;
  margin-top: 10px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-evenly;
}

.other_top_item_hover {
  background-color: #E4E7ED;
}

.likes_shop_items_other_top_item:hover {
  background-color: #E4E7ED;
}

.likes_shop_items_other_top_item {
  width: auto;
  padding: 0px 10px 0px 10px;
  height: 30px;
  font-size: 12px;
  line-height: 30px;
  border-left: 1px solid #E4E7ED;
  cursor: pointer;
}

.likes_shop_items_other_top_item:nth-child(1) {
  border-left: unset;
}

.likes_shop_items_other_top {
  width: 100%;
  height: 30px;
  display: flex;
  flex-wrap: nowrap;
  border-bottom: 1px solid #E4E7ED;
  margin-top: 5px;
}

.likes_shop_items_info_other:hover i {
  margin-left: 5px;
}

.likes_shop_items_info_other:hover {
  text-decoration: underline;
}

.likes_shop_items_info_other i {
  transition-duration: 0.3s;
}

.likes_shop_items_info_other {
  width: calc(100% - 20px);
  height: 30px;
  position: relative;
  top: 90px;
  line-height: 30px;
  padding-left: 20px;
  font-size: 12px;
  transition-duration: 0.3s;
  cursor: pointer;
}

.likes_shop_items_info_item_name i:hover {
  color: #958a7e;
}

.likes_shop_items_info_item_name i {
  margin-left: 10px;
  cursor: pointer;
}

.likes_shop_items_info_item_name a:hover {
  text-decoration: underline;
  color: #958a7e;
}

.likes_shop_items_info_item_name a {
  color: #442f1a;
  font-size: 16px;
  transition-duration: 0.3s;
  line-height: 80px;
}

.likes_shop_items_info_item_name {
  width: calc(100% - 80px);
  padding-left: 10px;
  height: 100%;
}

.likes_shop_items_info_item_img img {
  width: 60px;
  height: 60px;
  position: relative;
  top: 9px;
  left: 9px;
  border-radius: 50%;
  border: 2px solid #E4E7ED;
}

.likes_shop_items_info_item_img {
  width: 80px;
  height: 80px;
}

.likes_shop_items_info_item {
  width: 100%;
  height: 80px;
  display: flex;
  flex-wrap: nowrap;
}

.likes_shop_items_other {
  width: calc(100% - 300px);
  height: 100%;
}

.likes_shop_items_info {
  width: 300px;
  height: 200px;
}

.likes_shop_items {
  width: 100%;
  height: 200px;
  background-color: #FFFFFF;
  display: flex;
  flex-wrap: nowrap;
  border-radius: 5px;
  margin-top: 10px;
}

.likes_nav_search {
  width: calc(100% - 380px);
  height: 50px;
}

.likes_commodity_items_other_delbtn span:hover {
  text-decoration: underline;
}

.likes_commodity_items_other_delbtn span {
  position: relative;
  top: 30px;
  color: #442f1a;
  font-size: 12px;
  margin-right: 10px;
  cursor: pointer;
}

.likes_commodity_items_other_delbtn {
  width: 100%;
  height: 50px;
}

.likes_commodity_items_other_price span:first-child {
  color: #ff4400;
  font-size: 10px;
}

.likes_commodity_items_other_price span {
  display: inline-block;
  font-size: 20px;
  color: #ff5a00;
}

.likes_commodity_items_other_price {
  width: 100%;
  height: 30px;
}

.likes_commodity_items_other_title a:hover {
  color: #958a7e;
  text-decoration: underline;
}

.likes_commodity_items_other_title a {
  color: #333;
  font-size: 16px;
  line-height: 24px;
  transition-duration: 0.3s;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.likes_commodity_items_other_title {
  margin-top: 10px;
  width: 100%;
  height: 50px;
  color: #442f1a;
}

.likes_commodity_items_other {
  width: calc(100% - 160px);
  height: 100%;
}

.likes_commodity_items_img img {
  width: 130px;
  height: 130px;
  position: relative;
  top: 10px;
  left: 10px;
}

.likes_commodity_items_img {
  width: 150px;
  height: 150px;
}

.likes_commodity_items {
  width: 100%;
  height: 150px;
  display: flex;
  flex-wrap: nowrap;
  background-color: #ffffff;
  margin-top: 10px;
  border-radius: 5px;
}

.likes_shop_box {
  width: 1200px;
  height: auto;
  margin: 10px auto;
  border-radius: 5px;
}

.likes_nav_nav_btn_hover {
  background-color: #E4E7ED !important;
  color: #958a7e !important;
}

.likes_nav_nav_btn {
  width: 100px;
  height: 50px;
  line-height: 50px;
  font-size: 14px;
  color: #E4E7ED;
  cursor: pointer;
  text-align: center;
  background-color: #958a7e;
  float: left;
  transition-duration: 0.3s;
}

.likes_nav_nav {
  width: 210px;
  height: 50px;
  margin: 0 50px;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
}

.likes_nav_mid img {
  width: 70px;
  height: 50px;
}

.likes_nav_mid {
  width: 1200px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-wrap: nowrap;
}

.likes_nav {
  width: 100%;
  height: 50px;
  background-color: #958a7e;
  border-top: 1px solid #442f1a;
}

.likes {
  width: 100%;
  height: auto;
  background-color: #E4E7ED;
}

</style>
